package com.gitee.sxc25800.Zooooo;

import com.gitee.sxc25800.chen.Panda;
import com.gitee.sxc25800.cai.Sheep;
import com.gitee.sxc25800.zhang.Pig;
import com.gitee.sxc25800.zhu.Horse;

import java.util.Scanner;


/*
    @author: Chen
    @date: 2022/3/15 10:37 AM (UTC+8)
    @version: v1.0
    @description: 动物类
 */

public class Animals {

    private Panda panda = new Panda();
    private Sheep sheep = new Sheep();
    private Horse horse = new Horse();
    private Pig pig = new Pig();

    public void getAnimalsList() {
        String[] animals = {"panda", "sheep", "pig", "horse"};
        System.out.println("------------");
        System.out.println("动物列表:");
        for (String animal : animals) {
            System.out.println(animal);
        }
        System.out.println("------------");
    }

    public void setAnimalName(String animalType) {

        switch (animalType) {
            case "panda":
                System.out.println("请输入熊猫的名字：");
                Scanner inputPandaName = new Scanner(System.in);
                this.panda.setName(inputPandaName.nextLine());
                System.out.println("请输入熊猫的年龄：");
                Scanner inputPandaAge = new Scanner(System.in);
                this.panda.setAge(inputPandaAge.nextInt());
                System.out.println("请输入熊猫的食物：");
                Scanner inputPandaFood = new Scanner(System.in);
                this.panda.setFood(inputPandaFood.nextLine());
                System.out.println("请输入熊猫的颜色：");
                Scanner inputPandaColor = new Scanner(System.in);
                this.panda.setColor(inputPandaColor.nextLine());
                System.out.println("请输入熊猫的居住地：");
                Scanner inputPandaAddress = new Scanner(System.in);
                this.panda.setLocation(inputPandaAddress.nextLine());
                break;
            case "sheep":
                System.out.println("请分别输入名字，年龄，食物，颜色，居住地");
                Scanner inputSheepName = new Scanner(System.in);
                Scanner inputSheepAge = new Scanner(System.in);
                Scanner inputSheepFood = new Scanner(System.in);
                Scanner inputSheepColor = new Scanner(System.in);
                Scanner inputSheepLocation = new Scanner(System.in);
                this.sheep.setInfo(inputSheepName.nextLine(),inputSheepAge.nextInt(),inputSheepFood.nextLine(),inputSheepColor.nextLine(),inputSheepLocation.nextLine());
                break;
            case "pig":
                System.out.println("请输入猪的名字：");
                Scanner inputPigName = new Scanner(System.in);
                this.pig.setName(inputPigName.nextLine());
                System.out.println("请输入猪的年龄：");
                Scanner inputPigAge = new Scanner(System.in);
                this.pig.setAge(inputPigAge.nextInt());
                System.out.println("请输入猪的食物：");
                Scanner inputPigFood = new Scanner(System.in);
                this.pig.setFood(inputPigFood.nextLine());
                System.out.println("请输入猪的颜色：");
                Scanner inputPigColor = new Scanner(System.in);
                this.pig.setColor(inputPigColor.nextLine());
                System.out.println("请输入猪的居住地：");
                Scanner inputPigLocation = new Scanner(System.in);
                this.pig.setLocation(inputPigLocation.nextLine());
                System.out.println("请输入猪喜欢的东西：");
                Scanner inputPigLove =new Scanner (System.in);
                this.pig.setLove(inputPigLove.nextLine());
                break;
            case "horse":
                System.out.println("请输入马的名字：");
                Scanner inputHorseName = new Scanner(System.in);
                this.horse.setName(inputHorseName.nextLine());
                System.out.println("请输入马的年龄：");
                Scanner inputHorseAge = new Scanner(System.in);
                this.horse.setAge(inputHorseAge.nextInt());
                System.out.println("请输入马的食物：");
                Scanner inputHorseFood = new Scanner(System.in);
                this.horse.setFood(inputHorseFood.nextLine());
                System.out.println("请输入马的颜色：");
                Scanner inputHorseColor = new Scanner(System.in);
                this.horse.setColor(inputHorseColor.nextLine());
                System.out.println("请输入马的居住地：");
                Scanner inputHorseLocation = new Scanner(System.in);
                this.horse.setLocation(inputHorseLocation.nextLine());
                break;
        }

    }

    public void getData(String animal) {

        switch (animal) {
            case "panda":
                System.out.println(this.panda);
                break;
            case "sheep":
                System.out.println(this.sheep);
                break;
            case "pig":
                System.out.println(this.pig);
                break;
            case "horse":
                System.out.println(this.horse);
                break;
            default:
                System.out.println("没有这种动物");
        }
    }
}
